/**
 * 
 */
package org.bankabeule.util;

import org.bankabeule.Account;
import org.bankabeule.Operation;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;

/**
 * @author sdudoit
 *
 */
public class AccountAdapter extends AdapterImpl {

	
	/**
	 * 
	 */
	public void notifyChanged(Notification notification) {
		if (notification.getNotifier() instanceof Account) {
			if (notification.getEventType() == Notification.ADD) {
				if (notification.getNewValue() instanceof Operation) {
					operationAdded((Operation) notification.getNewValue());
				}
			} else if (notification.getEventType() == Notification.ADD_MANY) {
				System.out.println("AccountAdapter: ADD_MANY");			
			} else if (notification.getEventType() == Notification.REMOVE) {
				if (notification.getOldValue() instanceof Operation) {
					operationRemoved((Operation) notification.getOldValue(), (Account) notification.getNotifier());
					
				}
			} else if (notification.getEventType() == Notification.REMOVE_MANY) {
				System.out.println("AccountAdapter: REMOVE_MANY");			
			} else if (notification.getEventType() == Notification.SET) {
				accountChanged((Account) notification.getNotifier());
			}
		}
	}
	
	
	/**
	 * 
	 */
	public void operationAdded(Operation operation) {		
	}
	
	
	/**
	 * 
	 */
	public void operationRemoved(Operation operation, Account account) {		
	}
	
	
	/**
	 * 
	 */
	public void accountChanged(Account account) {		
	}
	
	
}
